////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2009 Daniel F. Hanson
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
////////////////////////////////////////////////////////////////////////////////

using System;

namespace SilverLua.Runtime
{
   /// <summary>
   /// Exposes a C# class or class member to SilverLua scripts. If applied to
   /// a class, all public members will be automatically exposed unless a
   /// LuaIgnore attribute is used on the member. If applied to a member, it
   /// must be non-public.
   /// </summary>
   [AttributeUsage(AttributeTargets.Class |
                   AttributeTargets.Constructor |
                   AttributeTargets.Field |
                   AttributeTargets.Method |
                   AttributeTargets.Property,
                   AllowMultiple = true)]
   public class LuaExposeAttribute : LuaRenameAttribute
   {
      /// <summary>
      /// Default constructor.
      /// </summary>
      public LuaExposeAttribute() : base()
      {
      }

      /// <summary>
      /// Constructor. Used to provide a different name to use in SilverLua
      /// scripts. Required for overloaded constructors and methods.
      /// </summary>
      /// <param name="name">The name exposed to SilverLua for this type or member</param>
      public LuaExposeAttribute(string name) : base(name)
      {
      }
   }
}
